package sfsoftware.game.actor;

import sfsoftware.game.TrevorLegacy;
import sfsoftware.game.actor.attributes.Collidable;
import sfsoftware.game.actor.attributes.Freezable;
import sfsoftware.game.trevor.Player;
import sfsoftware.util.Actor;

public class Lava extends Actor implements Freezable {
	
	public Lava(int destX, int destY)
	{
		super(destX, destY, "", 0, 120, 40, 40);
		setWalkable(false);
	}
	
	@Override
	public void collisionResult(Collidable object) {		
		super.collisionResult(object);
		// Touching lava hurts you!
		if(!getWalkable() && object.equals(TrevorLegacy.player))
		{
			Player.hurt(10);
		}
	}
	
	@Override
	public void freeze() {
		generateParticles(255, 1, 1, 1, 1);
		getCurrentTile().setSrcX(40);
		setWalkable(true);
	}

}
